package atguigu06.polymorphism.exer4;

/**
 * ClassName: Exer4
 * Package: atguigu06.polymorphism.exer4
 * Description:
 *
 * @Author BuTang
 * @Create 2023/3/8 14:04
 * @Version 1.0
 */
public class Exer4 {
    public void metting(Person... ps){
        for (int i = 0; i < ps.length; i++) {
            ps[i].eat();
            if (ps[i] instanceof Man) {
                ((Man) ps[i]).isSmoke();
            }else {
                ((Woman)ps[i]).makeup();
            }
        }
    }

    public static void main(String[] args) {
        Exer4 ex = new Exer4();
        ex.metting(new Man(),new Woman());
    }
}
